<!DOCTYPE html>
<html>
<head>
<title>短信日志列表</title>
<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>

		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.mobile" @keyup.enter="query" placeholder="手机号码">
			</div>
			<a class="btn btn-default" @click="query">查询</a>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
</div>

<script>
	$(function () {
		$("#jqGrid").jqGrid({
			url: baseURL + 'sys/smsCode/list',
			datatype: "json",
			colModel: [
				{ label: 'id', name: 'id', index: "id", width: 10, key: true ,hidden:true, key: true  },
				{ label: '手机号', name: 'telNum', index: "telNum", width: 70},
				{ label: '验证码', name: 'vcode', index: "vcode", width: 70},
				{ label: '类型', name: 'type', width: 60,formatter: function(value, options, row){
                        if(value == 1){
                            return  '<span>代理申请</span>';
                        }else if(value == 2){
                            return  '<span>找回密码</span>';
                        }else if(value == 4){
                            return  '<span >修改登录密码</span>';
                        }else if(value == 5){
                            return  '<span>修改支付密码</span>';
                        }else if(value == 6){
                            return  '<span>登录</span>';
                        }
                    } },
				{ label: '发送时间', name: 'sendTime', sortable: false, width: 90 }
			],
			viewrecords: true,
			height: 385,
			rowNum: 10,
			rowList : [10,30,50],
			rownumbers: true,
			rownumWidth: 25,
			autowidth:true,
			multiselect: true,
			pager: "#jqGridPager",
			jsonReader : {
				root: "page.list",
				page: "page.currPage",
				total: "page.totalPage",
				records: "page.totalCount"
			},
			prmNames : {
				page:"page",
				rows:"limit",
				order: "order"
			},
			gridComplete:function(){
				//隐藏grid底部滚动条
				$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
			}
		});

	});
	var setting = {
		data:{
			q:{
				mobile: null
			},
			title:null,
			moneylog:{

			}
		},
	};

	var vm = new Vue({
		el:'#rrapp',
		data:{
			q:{
				mobile: null
			},
			moneylog :{

			}
		},
		methods: {
			query: function () {
				vm.reload();
			},
			reload: function () {
				vm.showList = true;
				var page = $("#jqGrid").jqGrid('getGridParam','page');
				$("#jqGrid").jqGrid('setGridParam',{
					postData:{'mobile': vm.q.mobile},
					page:1
				}).trigger("reloadGrid");
			},

		},

	});
</script>

</body>
</html>